#pragma once
#include "Pascal.h"

	template <typename TItem, typename TItemManager>
	class TPool
	{
	public:
		typedef TItem TItem;
		typedef TFPGList<TItem> TItems;
	public:
		Pointer FParameter;
		TItems FAvailableItems;
	public:
		TItem GetItem();
		procedure FreeItem(TItem AItem);
	public:
		TPool();
		TPool(Pointer AParameter);
		~TPool();
	};

	template <typename T>
	class TDefaultPoolItemManager
	{
	public:
		static T CreateInstance(Pointer AParameter);
		static procedure ClearInstance(T AInstance, Pointer AParameter);
		static procedure DestroyInstance(T AInstance, Pointer AParameter);
	};